home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / Hierarchical Lists / Libs / CCustomListBox.h < prev    next >
Encoding:
Text File  |  1995-09-27  |  1.9 KB  |  59 lines  |  [TEXT/MMCC]

  1. // ===========================================================================
  2. //    CCustomListBox.h            ©1994 Jan Bruyndonckx All rights reserved.
  3. //    v1.0 18/6/94
  4. //
  5. //    A listbox subclass containing custom data.
  6. //  The default listbox contains only string data.
  7. // ===========================================================================
  8.  
  9. #pragma once
  10.  
  11. #include <LListBox.h>
  12.  
  13. //----------------------------------------------------------------------------
  14.  
  15. class CCustomListBox : public LListBox {
  16.  
  17.   public:
  18.       enum {
  19.           classID = 'clst'
  20.       } ;
  21.         
  22.     static CCustomListBox*    CreateFromStream(LStream *inStream);
  23.  
  24.     CCustomListBox() ;
  25.     CCustomListBox(const SPaneInfo &inPaneInfo,
  26.                         Boolean inHasHorizScroll, Boolean inHasVertScroll,
  27.                         Boolean inHasGrow, Boolean inHasFocusBox,
  28.                         MessageT inDoubleClickMessage, Int16 inTextTraitsID,
  29.                         LCommander *inSuper);
  30.     CCustomListBox(const CCustomListBox &inOriginal) ;
  31.     CCustomListBox(LStream *inStream);
  32.     
  33.     virtual void        *GetSelection (void *outDescriptor, short *outDescLen) const;
  34.     virtual void        SetSelection (const void *inDescriptor, const short inDescLen);
  35.  
  36.     virtual void         *GetCellPtr (const Cell cell, short *dataLen = NULL) ;
  37.  
  38.     virtual void        PrintPanelSelf(const PanelSpec &inPanel);
  39.     
  40.   protected:
  41.     virtual void         DrawElement (const short lMessage, const Boolean lSelect, const Rect *lRect,
  42.                                      const void *lElement, const short lDataLen) ;
  43.     virtual void        DrawElementSelf (const Rect *lRect, const void *lElement, const short lDataLen) ;
  44.  
  45.   private:
  46.       
  47.       void                init (void) ;
  48.       friend pascal static void  LDefProc (short lMessage, Boolean lSelect, Rect *lRect,
  49.                                      Cell lCell, unsigned short lDataOffset, unsigned short lDataLen, ListHandle lHandle) ;
  50.  
  51.  
  52.       enum {
  53.           callerLDEFResID     = 1100                // LDEF stub resource ID
  54.       } ;
  55.       static ListDefUPP    callerLDEFUPP ;
  56. } ;
  57.  
  58. //----------------------------------------------------------------------------
  59.